<template>
  <div class="housing-list flex">
    <div
      class="housing-list-item"
      v-for="item in buildList"
      :key="item.id"
      v-if="item"
      @click="go(item.id)"
    >
      <img class="img mb-16" :src="item.thumb" alt="" srcset="" />
      <p class="mb-12" style="font-size: 16px">
        {{ item.name }}{{ item.area }}㎡
      </p>
      <p style="color: #c7343c">{{ item.price }}元/月</p>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    buildList: {
      type: Array,
    },
  },
  methods: {
    go(id) {
      this.$router.push(`/detail/${id}`)
    },
  },
}
</script>

<style lang="less" scoped>
.housing-list {
  margin-bottom: 68px;
  .mb-16 {
    margin-bottom: 16px;
  }
  .mb-12 {
    margin-bottom: 12px;
  }
  .housing-list-item {
    margin-right: 22px;
    &:last-child {
      margin: 0;
    }
    .img {
      width: 222px;
      height: 168px;
      border-radius: 6px;
    }
  }
}
</style>